cmake_minimum_required(VERSION 3.10)
project(lrn_c_primer_plus)

set(CMAKE_C_STANDARD 11)

include_directories(tools)
add_library(my_tools tools/mytools.c)

set(BASIC_CONCEPT_SRC c_ref/language/basic_concept)
set(DECLARATIONS_SRC c_ref/language/declarations)

add_executable(basic_concept ${BASIC_CONCEPT_SRC}/main.c ${BASIC_CONCEPT_SRC}/data_type.c)
target_link_libraries(basic_concept my_tools)

add_executable(declarations ${DECLARATIONS_SRC}/main.c ${DECLARATIONS_SRC}/pointer.c ${DECLARATIONS_SRC}/array.c ${DECLARATIONS_SRC}/enum.c ${DECLARATIONS_SRC}/struct.c ${DECLARATIONS_SRC}/union.c)
target_link_libraries(declarations my_tools)